Write Line
System.Activities.Statements.Write Line
The "Write Line" activity in AutomatR is a simple yet powerful activity used to write text or information to the output console or a specified text file. This activity is commonly used for debugging purposes or to display information during the execution of a workflow.
Properties
Name | Description |
---|---|
Misc | |
Display Name | The display name of the activity. A display name is automatically generated when you indicate a target. |
Text | Specifies the text or information that will be written to the output console or a text file. This can be a literal string, a variable, or an expression. String variables, expressions, or constants containing the text to be written. |
Text Writer | Specifies the text file to which the text will be written. By default, it writes to the output console, but you can choose a specific text file by providing the file path. String variables containing the file path. You can use variables to dynamically set the file path during runtime. |
How to use:
- Drag and drop the "Write Line" activity onto the workflow.
- In the "Text" property, specify the text or information you want to write.
- Optionally, in the "Text Writer" property, provide the file path if you want to write the text to a specific file.
Example: Consider an example where the "Write Line" activity is used to log information during the execution of a workflow:
Write Line:
Display Name: "Log Message"
Text: "Processing item: " + currentItem
In this example, the "Write Line" activity logs a message to the output console, indicating the processing of a specific item. The "Text" property is set to a string concatenation, allowing for dynamic messages based on the value of the "currentItem" variable.
Note: If you want to write to a text file, you can provide the file path in the "Text Writer" property. For example:
Write Line:
Display Name: "Log to File"
Text: "This message will be written to a file."
Text Writer: "C:\Logs\logfile.txt"
In this case, the "Write Line" activity writes the specified text to the file located at "C:\Logs\logfile.txt."